package org.redmagic.service.domain.ui;

import static com.google.common.collect.Lists.transform;

import java.util.List;

import org.redmagic.service.utils.RedMagicProperties;
import org.springframework.util.AutoPopulatingList;

public class DisplayProperty {

	private String id;
	private String name;
	private String value;
	private List<Tag> tags;
	private List<String> tagNames;
	
	public DisplayProperty() {
		this.tags = new AutoPopulatingList<Tag>(Tag.class);
		this.tags.add(new Tag(""));
		this.tagNames = transform(tags, RedMagicProperties.TAG_VALUE_FUNCTION);
	}
	
	public DisplayProperty(List<Tag> tags) {
		this.tags = tags;
		this.tagNames = transform(tags, RedMagicProperties.TAG_VALUE_FUNCTION);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public List<Tag> getTags() {
		return tags;
	}

	public void setTags(List<Tag> tags) {
		this.tags = tags;
	}

	public List<String> getTagNames() {
		return tagNames;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
}
